package lupos;

import org.w3c.dom.Element;

/** 
 * The role of this class is to parse 'pos' elements of 
 * FrameNet 1.3 annotation files. The format of these
 * elements is as follows:
 * 
 *   pos @name @start @end
 *   
 * There is a bug involving POS tags in the source files - 
 * some POS tags at the end of an utterance are ill-formed,
 * ending before they start! e.g. lu9724, lu922, lu9087, 
 * lu9055, etc. I just ignore them. 
 */

public class Pos {

	public String name;
	public String start;
	public String end;
	public String text; //the word-form itself
	
	public Pos(Element e,String txt) throws StringIndexOutOfBoundsException {
		name = e.getAttribute("name");
		start = e.getAttribute("start");
		end = e.getAttribute("end");
		text = txt.substring(Integer.parseInt(start),Integer.parseInt(end)+1);		
	}
	
}
